package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.pojo.*;
import org.example.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RequestMapping("/log/page")
@RestController
public class LogController {
    @Autowired
    private LogService logService;
    private Integer page = 1;  // 默认页码为 1
    private Integer pageSize = 10;  // 默认每页大小为 10
    @GetMapping
    public Result list(){
        log.info("查询全部日志记录");
        PageResult<OperateLog> pageResult = logService.page(page, pageSize);
        return Result.success(pageResult);
    }
}
